//
//  MVCView.m
//  架构
//
//  Created by 王玉东 on 2018/10/9.
//  Copyright © 2018 WYD. All rights reserved.
//

#import "MVCView.h"

@interface MVCView()
@property(nonatomic,strong)UIButton *button;

@end


@implementation MVCView

-(void)printOnview:(MVCmodel *)mymodel{
    
    NSLog(@"%@",mymodel.content);
    
}
-(instancetype)init{
    self = [super init];
    if (self) {
      
        self.button = [UIButton new];
        self.button.frame = CGRectMake(100, 100, 60, 30);
        [self addSubview:self.button];
        [self.button setTitle:@"print" forState:UIControlStateNormal];
        [self.button addTarget:self action:@selector(clickbutton) forControlEvents:UIControlEventTouchUpInside];
        
        
        
    }
    return self;
}
-(void)clickbutton{
    
    if(_delegate){
        
        [self.delegate onprintBtnclick];
        
        
    }
    
    
}


/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
